﻿using QFramework.Fullstack;

namespace FangKuaiXiaoXiaoLe
{
    public class MouseDownCommand : ICommand
    {
        public CodePrefab mCode;

        public MouseDownCommand(CodePrefab code)
        {
            mCode = code;
        }

        public void Execute()
        {
            var grid = Framework.LogicLayer.Get<Grid>();
            
            grid.DownCode(mCode);
        }
    }
    
    public class MouseUpCommand : ICommand
    {
        public void Execute()
        {
            var grid = Framework.LogicLayer.Get<Grid>();
            
            grid.UpCode();
        }
    }
    
    public class MouseEnterCommand : ICommand
    {
        public CodePrefab mCode;

        public MouseEnterCommand(CodePrefab code)
        {
            mCode = code;
        }

        public void Execute()
        {
            var grid = Framework.LogicLayer.Get<Grid>();
            
            grid.EnterCode(mCode);
        }
    }
}